<!doctype html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>见闻间</title>
    <link rel="stylesheet" href="/install/css/ixx.css" />
</head>

<body>
    <div id="ixx3" class="container">
        <div class="content">
            <div class="content-img">
                <video class="bg" src="/install/img/1.mp4" autoplay loop muted :controls="false"
                    :show-center-play-btn="false" object-fit="cover">
                </video>
                <div class="name">
                    见闻间 - 让社区以全新的方式喧起来<br>
                    官网：https://cc.chaopin100.com/#/xinxuan<br>
                    Copyright © 2024 Supengjun. All Rights Reserved. 陕西超拼软件科技有限公司 版权所有
                </div>
            </div>
            <div class="content-box">
                <div class="t1">安装进度 🚀</div>
                <div class="t2">installation progress.</div>
                <div class="loader">
                    <div class="progress" :style="{width: process+'%'}"></div>
                </div>
                <div class="t2">⏳ {{msg}}（{{process}}%）</div>
                <div class="tips">
                    <span>后台默认账号（登录后请及时修改避免信息泄露）</span><br>
                    <span>账号：admin</span><br>
                    <span>密码：123456</span>
                </div>
                <div v-if="process==100" class="btn abg" @click="toAdmin">前往后台</div>
                <div v-else class="btn">前往后台</div>
            </div>
        </div>
    </div>
</body>
<script src="/install/js/vue2.6.11.js"></script>
<script src="/install/js/element-ui.js"></script>
<script src="/install/js/axios.min.js"></script>
<script>
    new Vue({
        el: '#ixx3',
        data() {
            return {
                msg: '',
                process: 0,
            }
        },
        created() {
            console.log('created')
            this.install(0)
        },
        methods: {
            toAdmin() {
                window.location.href = '/super/index.html'
            },
            install(n) {
                const _this = this;
                axios({
                    method: 'post',
                    url: '/install/index/migrations',
                    data: {
                        n
                    }
                }).then(res => {
                    _this.msg = res.data.msg
                    _this.process = res.data.data.process
                    if (res.data.data.process == 100) {

                    } else {
                        setTimeout(function () {
                            _this.install(res.data.data.n)
                        }, 2000)

                    }
                });
            }
        }
    })
</script>

</html>